import axios from "axios";

const instance = axios.create({
    baseURL: '/api',
    timeout: 10000,
    headers: {'X-Custom-Header': 'test'}
});

export default {
    // get 请求
    testHello: function (param) {
        console.log("instance.get('/api/hello')")
        return instance.get('/hello?'+param).then(function (response) {
            console.log("response.data:====" + response.data)
            return response;
        });
    },
    // post 请求
    postHello: function (data) {
        return instance.post('/hello/post-hello', data).then(function (re) {
            console.log("response.data:====" + re.data)
            return re;
        })
    }
}